/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2015-07-29     Arda.Fu      first implementation
 */
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>

#include <key.h>
#include <uart2.h>
#include <motor.h>
#include <fpc1020.h>


void thread_main_entry(void* parameter)
{    
    // 打开uart2
    rt_err_t ret = uart2_open();
    if (ret != RT_EOK) rt_kprintf("uart2_open err \r\n");

	fpc1020_init();
    key_init();
	motor_init();


    //
	rt_kprintf("\r\n Start! \r\n");

    // while (1)
    // {
     
    //     rt_thread_mdelay(20);
    // }
}

int main(void)
{
    rt_thread_t tid;

    /* 创建main线程 */
    tid = rt_thread_create("main",thread_main_entry,RT_NULL,1024,2,10);
    if (tid != RT_NULL) rt_thread_startup(tid);

    return 0;
}
